package com.landian.commons.jpa.utils;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;

/**
 * @deprecated Use {@link com.landian.commons.jpa.builder.PageRequestBuilder} instead.
 * @author caojl
 */
@Deprecated
public class PageRequestBuilder {

    /**
     * @deprecated Use {@link com.landian.commons.jpa.builder.PageRequestBuilder#newInstance(int, int)} instead.
     * @param page
     * @param size
     * @return
     */
    @Deprecated
    public static PageRequest newInstance(int page, int size){
        return com.landian.commons.jpa.builder.PageRequestBuilder.newInstance(page,size);
    }

    @Deprecated
    public static PageRequest newInstance(int page, int size, Sort.Direction direction, String... properties){
        return com.landian.commons.jpa.builder.PageRequestBuilder.newInstance(page,size,direction,properties);
    }

    @Deprecated
    public static PageRequest newInstance(int page, int size, String direction, String... properties){
        return com.landian.commons.jpa.builder.PageRequestBuilder.newInstance(page,size,Sort.Direction.fromString(direction),properties);
    }

    @Deprecated
    public static PageRequest newInstance(int page, int size, Sort sort){
        return com.landian.commons.jpa.builder.PageRequestBuilder.newInstance(page,size,sort);
    }
}
